package com.iepacj.vo;

import java.util.Date;
import java.util.List;

/**
 * Created by iEpac on 16/4/17.
 */
public class Community {

    private String id;

    private String commonName;

    private Double lng;

    private Double lat;

    private Double[] loc;

    private CommunityMaster master;

    private List<CommunityMember> members;

    private Integer status;

    private Date createTime;

    public class CommunityMaster {

        private Long id;

        private String memName;

        private String latest;

        public Long getId() {
            return id;
        }

        public void setId(Long id) {
            this.id = id;
        }

        public String getLatest() {
            return latest;
        }

        public void setLatest(String latest) {
            this.latest = latest;
        }

        public String getMemName() {
            return memName;
        }

        public void setMemName(String memName) {
            this.memName = memName;
        }

        @Override
        public String toString() {
            return "CommunityMaster{" +
                    "id=" + id +
                    ", memName='" + memName + '\'' +
                    ", latest='" + latest + '\'' +
                    '}';
        }
    }


    public class CommunityMember {

        private Long id;

        private String memName;

        private Date joinTime;

        private String latest;

        /**
         * 是否是管理员, 不存储 内存中生成
         */
        private Integer isMaster = 0;

        @Override
        public int hashCode() {
            return getId().hashCode();
        }

        @Override
        public boolean equals(Object obj) {
            CommunityMember member = (CommunityMember) obj;
            return getId().longValue() == member.getId().longValue();
        }

        public Long getId() {
            return id;
        }

        public void setId(Long id) {
            this.id = id;
        }

        public String getMemName() {
            return memName;
        }

        public void setMemName(String memName) {
            this.memName = memName;
        }

        public Date getJoinTime() {
            return joinTime;
        }

        public void setJoinTime(Date joinTime) {
            this.joinTime = joinTime;
        }

        public String getLatest() {
            return latest;
        }

        public void setLatest(String latest) {
            this.latest = latest;
        }

        public Integer getIsMaster() {
            return isMaster;
        }

        public void setIsMaster(Integer isMaster) {
            this.isMaster = isMaster;
        }
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getCommonName() {
        return commonName;
    }

    public void setCommonName(String commonName) {
        this.commonName = commonName;
    }

    public Double getLng() {
        return lng;
    }

    public void setLng(Double lng) {
        this.lng = lng;
    }

    public Double getLat() {
        return lat;
    }

    public void setLat(Double lat) {
        this.lat = lat;
    }

    public Double[] getLoc() {
        return loc;
    }

    public void setLoc(Double[] loc) {
        this.loc = loc;
    }

    public CommunityMaster getMaster() {
        return master;
    }

    public void setMaster(CommunityMaster master) {
        this.master = master;
    }

    public List<CommunityMember> getMembers() {
        return members;
    }

    public void setMembers(List<CommunityMember> members) {
        this.members = members;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
}
